<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>
	</head>
	<body>
		<div id="app">
			<input type="text" v-model="num1" />
			<select v-model="op">
				<option>+</option>
				<option>-</option>
				<option>*</option>
				<option>/</option>
			</select>
			<input type="text" v-model="num2"/>
			<input type="button" value="=" @click="calc"/>
			<input type="text" :value="result"/>
		</div>

		<script>
			const vm = Vue.createApp({
				data() {
					return {
						num1: "",
						num2: "",
						op: "+",
						result: ""
					}
				},
				methods:{
					calc()
					{
						console.log("calc()");
						switch(this.op)
						{
							case "+":
								this.result = parseInt(this.num1) + parseInt(this.num2)
							break;
							case "-":
								this.result = parseInt(this.num1) - parseInt(this.num2)
							break;
							case "*":
								this.result = parseInt(this.num1) * parseInt(this.num2)
							break;
							case "/":
								this.result = parseInt(this.num1) / parseInt(this.num2)
							break;																					
						}
					}
				}
			})
			vm.mount("#app");
		</script>
	</body>
</html>
